

#pragma once

#include <Singleton.h>
#include <threadSync_t.h>

class uiMutex_t : public Singleton<uiMutex_t>
{
	friend class Singleton<uiMutex_t>;
protected:
	uiMutex_t(){};
	~uiMutex_t(){};

public:
	void uiLock(){m.Lock();};
	void uiUnlock(){m.Unlock();};

public:
	Mutex m;
};

#define UI_LOCK uiMutex_t::GetSingleton()->uiLock();
#define UI_UNLOCK uiMutex_t::GetSingleton()->uiUnlock();
#define UI_MUTEX threadSync_t ts(&uiMutex_t::GetSingleton()->m);